package com.ashapo.pattern.pattern010decorator;

//第5步
//使用RedShapeDecorator装饰Shape对象。

public class DecoratorPatternDemo {

    /**
     * 装饰器模式
     * @param args
     */
    public static void main(String[] args) {

        Shape circle = new Circle();

        Shape redCircle = new RedShapeDecorator(new Circle());

        Shape redRectangle = new RedShapeDecorator(new Rectangle());
        System.out.println("Circle with normal border");
        circle.draw();

        System.out.println("\nCircle of red border");
        redCircle.draw();

        System.out.println("\nRectangle of red border");
        redRectangle.draw();
    }
}
